﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.IO;
using System.Linq;
using System.Text;
using PdfConverter;

namespace PdfConverter
{
    public class AquaforestPdfConverter : IPdfConverter 
    {

        public byte[] Convert(byte[] bytes)
        {
            throw new NotImplementedException();
            //string path = ConfigurationManager.AppSettings["AquaForestInstallPath"];
            //string temp = ConfigurationManager.AppSettings["AquaForestTempFolder"];
            //Ocr ocr = new Ocr();
            //PreProcessor preProcessor = new PreProcessor();

            //ocr.ResourceFolder = path;

            //// 3. Set PreProcessor Options
            //preProcessor.Deskew = true;
            //preProcessor.Autorotate = false;

            //// 4. Set OCR Options 
            //ocr.Language = SupportedLanguages.English;
            //ocr.EnablePdfOutput = true;
            //string filename = Guid.NewGuid().ToString() + ".pdf";
            //string outputfilename = Guid.NewGuid().ToString() + ".pdf";
            //File.WriteAllBytes(Path.Combine(temp,filename),bytes);

            //// 5. Read Source TIFF File
            //ocr.ReadPDFSource(Path.Combine(temp, filename));

            //// 6. Perform OCR Recognition
            //if (ocr.Recognize(preProcessor))
            //{
            //    // 7. Save Output as Searchable PDF

            //    ocr.SavePDFOutput(Path.Combine(temp,outputfilename), true);
            //}

            //// 8. Clean Up Temporary Files
            //ocr.DeleteTemporaryFiles();

            //return File.ReadAllBytes(Path.Combine(temp, outputfilename));
        }
    }
}
